package cn.sharp.bbs.entity.DO;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class msgDto implements Comparable<msgDto>{
    private Long msgId;
    private Long userId;
    private String userName;
    private String userAvatar;
    private Long targetId;
    private String targetName;
    private int type;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    private int checked;

    @Override
    public int compareTo(msgDto o) {
        return (int) (o.getMsgId() - this.msgId);
    }
}
